package org.cupk2.zhzm.service;

import jakarta.validation.Valid;
import org.cupk2.zhzm.domain.ZhzmKnow;
import org.cupk2.zhzm.dto.web.IndexTagsDto;
import org.cupk2.zhzm.dto.web.WebKnowDto;
import org.cupk2.zhzm.dto.web.WebTagDto;
import org.cupk2.tools.db.DataQuery;
import org.cupk2.tools.db.DataResult;

import java.util.List;

/**知识 
 * @author cbtg自动生成  2025-2-4 12:13:51 
 */
public interface ZhzmKnowServiceInter {

    public ZhzmKnow insertZhzmKnowEntity(ZhzmKnow zhzmKnow);

    public ZhzmKnow editZhzmKnowEntity(ZhzmKnow zhzmKnow);

    public void delZhzmKnow(String id);

    public ZhzmKnow getZhzmKnowById(String id);

    public List<ZhzmKnow> getZhzmKnows(DataQuery query);

    public DataResult searchZhzmKnow(DataQuery query);

    public int getZhzmKnowNum(DataQuery query);
    
    public int getNum(DataQuery query);

    /**
     * 创建知识（前台）
     *
     * @param webKnowDto
     * @return
     */
    public ZhzmKnow creatKnow(WebKnowDto webKnowDto);

    /**
     * 知识原文本的读取，请不要做任何修饰
     *
     * @param know
     * @return
     */
    public String getKnowText(ZhzmKnow know);

    /**
     * 获取格式化的HTML
     *
     * @param know
     * @return
     */
    public String getKnowHtml(ZhzmKnow know);

    /**
     * 修改知识
     *
     * @param webKnowDto
     * @return
     */
    public ZhzmKnow editKnow(@Valid WebKnowDto webKnowDto);

    /**
     * 获得知识失效的附件ID
     *
     * @param know
     * @return
     */
    public List<String> getInvalidVersionFileIds(ZhzmKnow know);

    /**
     * 获取前端显示的标签
     *
     * @param know
     * @return
     */
    public List<WebTagDto> getKnowTagDtos(ZhzmKnow know);

    public IndexTagsDto getKnowIndexTags(ZhzmKnow know);

    /**
     * 获得预览图的id
     *
     * @param knowid 知识id
     * @return
     */
    public List<String> getImgView(String knowid);

    /**
     * 获得我的知识数量
     *
     * @param userKey
     * @return
     */
    public int getKnowNumByUser(String userKey);

    /**
     * 获得最新知识数量
     *
     * @param userKey
     * @return
     */
    public int getNewKnowsNum(String userKey);

    /**获得知识当前版本附件
     * @param knowid
     * @param key
     * @return
     */
    public List<String> getKnowFiles(String knowid, String key);
}
